package com.weme.common.dialog

import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.DialogFragment
import com.weme.common.R
import com.weme.common.base.BaseDialog
import com.weme.common.databinding.DialogGiftSendSuccessBinding
import com.weme.common.util.loadImage

class GiftSendSuccessDialog(var name:String,var headPic:String) : BaseDialog() {
    override fun onStart() {
        super.onStart()
        dialog?.window?.apply {
            setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
            setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))

        }
    }

    private lateinit var binding: DialogGiftSendSuccessBinding

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        binding = DialogGiftSendSuccessBinding.inflate(inflater, container, false)
        binding.tvContent.text = String.format(getString(com.example.resources.R.string.gitt_send_success_content),name,name)
        binding.rimHead.loadImage(headPic)

        return binding.root
    }
}